//
//  JWSentinel.h
//  KotH
//
//  Created by James Weatherley on 02/11/2009.
//  Copyright 2009 James Weatherley. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "JWEntity.h"
#import "../env/vector.h"

@class JWSquare;
@class JWPicker;
@class JWMeanie;

@interface JWSentinel : NSObject <JWEntity> {
	
	NSUInteger sentinelId;
	JWSquare* square;
	JWMeanie* meanie;
	
	BOOL canCreateMeanie;
	BOOL selected;
	float theta;
	NSUInteger noDamage;
	
	vec3_t headVertices[8];
	vec3_t headNormals[6];
	
	vec3_t bodyVertices[8];
	vec3_t bodyNormals[4];
}

@property (readwrite) BOOL selected;
@property (readonly) JWSquare* square;
@property (readonly) float theta;
@property (readwrite) NSUInteger sentinelId;

-(void)doWork;
-(float)checkPlayer;
-(BOOL)squareVisible:(JWSquare*)s;

#pragma mark Meanie
-(BOOL)createMeanie;
-(void)meanieFinished;

#pragma mark Class methods
+(void)resting:(BOOL)rest;
+(BOOL)resting;
+(NSUInteger)warningMask;
+(NSUInteger)dangerMask;
+(void)clearMasks;

#pragma mark Geometry
-(void)calculateSentinelGeometry;

-(vec3_t*)bodyNormals;
-(vec3_t*)bodyVertices;
-(vec3_t*)headNormals;
-(vec3_t*)headVertices;

@end
